package cn.iocoder.yudao.module.research.controller.admin.alert;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.research.controller.admin.alert.vo.AlertChatReqVO;
import cn.iocoder.yudao.module.research.service.alert.AlertService;
import cn.iocoder.yudao.module.research.service.alert.ChatService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - 聊天")
@RestController
@RequestMapping("/research/chat")
@Validated
public class ChatController {

    @Resource
    private ChatService chatService;

    @Resource
    private AlertService alertService;

    @PostMapping("/create")
    @Operation(summary = "LLM交互")
    public CommonResult<String> createChat(@Valid @RequestBody AlertChatReqVO chatReqVO) {
        return success(alertService.createChat(chatReqVO));
    }


}